<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of add_history</title>
  <meta name="keywords" content="add_history">
  <meta name="description" content="Adds HIST_STR to OBJNAME's history field.">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<!-- menu.html . -->
<h1>add_history
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>Adds HIST_STR to OBJNAME's history field.</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function [subj] = add_history(subj,objtype,objname,hist_str,displayme) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Adds HIST_STR to OBJNAME's history field.

 [SUBJ] = ADD_HISTORY(SUBJ,HIST_STR,OBJTYPE,OBJNAME,[DISPLAYME])

 DISPLAYME (optional, default = false). If true, the HIST_STR gets
 echoed to the screen as well.

 If OBJTYPE = 'subj', then will append to the SUBJ header.history</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="datetime.html" class="code" title="function [dt] = datetime(seconds)">datetime</a>	Spits out the date and time in yymmdd_HHMM format</li><li><a href="get_object.html" class="code" title="function [obj] = get_object(subj,objtype,objname)">get_object</a>	Return the entire object.</li><li><a href="set_object.html" class="code" title="function [subj] = set_object(subj,objtype,objname,obj)">set_object</a>	Replaces an entire object, i.e. a cell from one of the main 4 cell arrays</li></ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="create_pattern_from_mask.html" class="code" title="function [subj] = create_pattern_from_mask(subj,old_patname,maskname,new_patname,varargin)">create_pattern_from_mask</a>	Creates a new pattern by masking an old one</li><li><a href="create_thresh_mask.html" class="code" title="function [subj] = create_thresh_mask(subj,map_patname,new_maskname,thresh,varargin)">create_thresh_mask</a>	Create a boolean mask by thresholding a statmap</li><li><a href="create_xvalid_indices.html" class="code" title="function [subj] = create_xvalid_indices(subj,runs_selname,varargin)">create_xvalid_indices</a>	Creates a selector for each iteration for leave-one-out cross-validation.</li><li><a href="load_afni_mask.html" class="code" title="function [subj] = load_AFNI_mask(subj,new_maskname,filename)">load_afni_mask</a>	Loads an AFNI dataset into the subj structure as a mask</li><li><a href="load_afni_pattern.html" class="code" title="function [subj] = load_AFNI_pattern(subj,new_patname,maskname,filenames)">load_afni_pattern</a>	Loads an AFNI dataset into a subject structure</li><li><a href="load_pattern_from_hd.html" class="code" title="function [subj] = load_pattern_from_hd(subj,patname)">load_pattern_from_hd</a>	Reverse of MOVE_PATTERN_TO_HD</li><li><a href="move_pattern_to_hd.html" class="code" title="function [subj pathfilename] = move_pattern_to_hd(subj,patname,varargin)">move_pattern_to_hd</a>	Moves the pattern MAT to the hard disk</li><li><a href="save_subj.html" class="code" title="function [subj fn] = save_subj(subj,varargin)">save_subj</a>	This just saves the subj structure to a file.</li><li><a href="statmap_anova.html" class="code" title="function [subj] = statmap_anova(subj,data_patname,regsname,selname,new_map_patname,extra_arg)">statmap_anova</a>	Use the anova to select features that vary between conditions</li><li><a href="statmap_template.html" class="code" title="function [subj] = statmap_template(subj,data_patname,regsname,selname,new_map_patname,extra_arg)">statmap_template</a>	This is the sample/template statmap generation function</li><li><a href="zscore_runs.html" class="code" title="function [subj new_patname] = zscore_runs(subj,patname,selname)">zscore_runs</a>	Zscore each voxel, separately for each run</li></ul>
<!-- crossreference -->

<h2><a name="_subfunctions"></a>SUBFUNCTIONS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="#_sub1" class="code">function [subj] = add_subj_history(subj,hist_str)</a></li></ul>
<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [subj] = add_history(subj,objtype,objname,hist_str,displayme)</a>
0002 
0003 <span class="comment">% Adds HIST_STR to OBJNAME's history field.</span>
0004 <span class="comment">%</span>
0005 <span class="comment">% [SUBJ] = ADD_HISTORY(SUBJ,HIST_STR,OBJTYPE,OBJNAME,[DISPLAYME])</span>
0006 <span class="comment">%</span>
0007 <span class="comment">% DISPLAYME (optional, default = false). If true, the HIST_STR gets</span>
0008 <span class="comment">% echoed to the screen as well.</span>
0009 <span class="comment">%</span>
0010 <span class="comment">% If OBJTYPE = 'subj', then will append to the SUBJ header.history</span>
0011 
0012 
0013 <span class="keyword">if</span> ~exist(<span class="string">'displayme'</span>)
0014   displayme = false;
0015 <span class="keyword">end</span>
0016 
0017 <span class="keyword">if</span> displayme
0018   disp(hist_str);
0019 <span class="keyword">end</span>
0020 hist_str = sprintf(<span class="string">'%s: %s'</span>,<a href="datetime.html" class="code" title="function [dt] = datetime(seconds)">datetime</a>(),hist_str);
0021 
0022 <span class="comment">% Deal with OBJTYPE == 'subj' as a special case</span>
0023 <span class="keyword">if</span> strcmp(objtype,<span class="string">'subj'</span>)
0024   subj = <a href="#_sub1" class="code" title="subfunction [subj] = add_subj_history(subj,hist_str)">add_subj_history</a>(subj,hist_str);
0025   <span class="keyword">return</span>
0026 <span class="keyword">end</span>
0027 
0028 obj = <a href="get_object.html" class="code" title="function [obj] = get_object(subj,objtype,objname)">get_object</a>(subj,objtype,objname);
0029 
0030 <span class="keyword">if</span> ~isfield(obj,<span class="string">'header'</span>)
0031   obj.header.history = [];
0032 <span class="keyword">end</span>
0033 <span class="keyword">if</span> ~isfield(obj.header,<span class="string">'history'</span>)
0034   obj.header.history=[];
0035 <span class="keyword">end</span>
0036   
0037 obj.header.history{end+1}=hist_str;
0038 
0039 subj = <a href="set_object.html" class="code" title="function [subj] = set_object(subj,objtype,objname,obj)">set_object</a>(subj,objtype,objname,obj);
0040 
0041 
0042 
0043 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
0044 <a name="_sub1" href="#_subfunctions" class="code">function [subj] = add_subj_history(subj,hist_str)</a>
0045 
0046 <span class="comment">% [SUBJ] = ADD_SUBJ_HISTORY(SUBJ,HIST_STR)</span>
0047 <span class="comment">%</span>
0048 <span class="comment">% Appends the hist_str to the subj.header</span>
0049 
0050 
0051 <span class="keyword">if</span> ~isfield(subj,<span class="string">'header'</span>)
0052   subj.header.history=[];
0053 <span class="keyword">end</span>
0054 <span class="keyword">if</span> ~isfield(subj.header,<span class="string">'history'</span>)
0055   subj.header.history=[];
0056 <span class="keyword">end</span>
0057 
0058 subj.header.history{end+1}=hist_str;</pre></div>
<hr><address>Generated on Wed 31-Aug-2005 15:27:57 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" target="_parent">m2html</a></strong> &copy; 2003</address>
</body>
</html>